package xcmg.device.dao.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import xcmg.device.dao.entity.company.CompanySupplierDO;
import xcmg.device.service.vo.basic.MaterialsSupplierVO;
import xcmg.device.service.vo.company.CompanySupplierVO;
@Mapper
public interface CompanySupplierMapper {
    int deleteByPrimaryKey(Long id);

    int insert(CompanySupplierDO record);

    CompanySupplierDO item(Long id);
    CompanySupplierDO itemByCode(@Param("orgId")String orgId,@Param("supplierCode")String supplierCode);

    CompanySupplierDO itemBySupplierOrgId(@Param("orgId")String orgId,@Param("supplierOrgId")String supplierOrgId);

    int update(CompanySupplierDO record);

    List<CompanySupplierDO> list(CompanySupplierVO record);

    List<CompanySupplierDO> listIsPlatCompany(CompanySupplierVO record);

    /**
     * 查询验证码发送方是否为该企业的供应商
     * @param orgId
     * @param sendId
     * @return
     */
    int countSupplierByInvitationCode(@Param("orgId")String orgId, @Param("sendId")String sendId);

    int updateApplyStatus(@Param("orgId")String orgId,@Param("supplierOrgId")String supplierOrgId,@Param("applyStatus")Integer applyStatus);

    int boundSupplier(@Param("platOrgId")String platOrgId,@Param("orgId")String orgId,@Param("supplierOrgId")String supplierOrgId);

    /**
     * 零件添加供应商，选择供应商列表，要求供应商为直投，且为加入到对应零件供应商中

     * @return
     */
    List<CompanySupplierDO> list4MaterialsSupplier(MaterialsSupplierVO record);

    List<CompanySupplierDO> listForPurchasePrice(CompanySupplierVO filters);
    
    List<CompanySupplierDO> listSellUnit(CompanySupplierVO filters);
    
}
